﻿using EnvDTE;

namespace Yama.TemplateWizard
{
    public class StartupProjectWizard : ProjectWizard
    {
        public override void ProjectFinishedGenerating(Project project)
        {
            SetAsStartupProject(project);

            CreateAdditionalDirectories(project);
        }

        private static void SetAsStartupProject(Project project)
        {
            Dte.Solution.SolutionBuild.StartupProjects = project.FullName;
        }

        private static void CreateAdditionalDirectories(Project project)
        {
            var viewsFolder = project.ProjectItems.AddFolder("Views");

            viewsFolder.ProjectItems.AddFolder("Rescues");
            viewsFolder.ProjectItems.AddFolder("mail");
            viewsFolder.ProjectItems.AddFolder("Home");
            viewsFolder.ProjectItems.AddFolder("Layouts");
        }
    }
}
